<template>
    <div class="myinsuretwo">
        <div v-show="lever != 2" class="contentempt"></div>
        <div class="myinsuretwo_center">
            <div class="titlewai">
                <div class="titleone" v-show="lever != 2" @click="renzheng()">
                    <img src="~@/assets/img/laba.png" style=" position: absolute; left: 25px; top: 11px;" alt="">
                    <p style="position: absolute; left: 46px; top: 8px;">点击此处完成实名认证，完善保障功能</p><img style="width: 4px;height: 7px;position: absolute; left: 290px;top: 15.5px;" src="~@/assets/img/youjiant.png" alt="">
                </div>
                <div class="titletwo">
                    <p class="titletwop1">{{this.name}}</p>
                    <p class="titletwop2" @click="jumpseach()">他人保单查询</p>
                </div>
                <div class="title">
                    <div class="titlecontent">
                        <div class="titlec">
                            <p class="titleitem" @click="titlelist(1);">
                                <span v-bind:class=" statearr==1 ? {activespan: isActive}:{active:false}">{{xian_state}}</span>
                                <img v-if=" statearr==1 " src="~@/assets/img/lshang.png" alt="">
                                <img v-else src="~@/assets/img/list_xia.png" alt="">
                            </p>
                            <p class="titleitem" @click="titlelist(2);">
                                <span v-bind:class=" statearr==2 ? {activespan: isActive}:{active:false}">{{appliy_state}}</span>
                                <img v-if=" statearr==2 " src="~@/assets/img/lshang.png" alt="">
                                <img v-else src="~@/assets/img/list_xia.png" alt="">
                                <!--  <img v-bind:class=" statearr==2 ? {active: isActive}:{active:false}" src="~@/assets/img/list_xia.png" alt=""> -->
                            </p>
                            <p class="titleitem" @click="titlelist(3);">
                                <span v-bind:class=" statearr==3 ? {activespan: isActive}:{active:false}">{{policy_state}}</span>
                                <img v-if=" statearr==3 " src="~@/assets/img/lshang.png" alt="">
                                <img v-else src="~@/assets/img/list_xia.png" alt="">
                                <!-- <img v-bind:class=" statearr==3 ? {active: isActive}:{active:false}" src="~@/assets/img/list_xia.png" alt=""> -->
                            </p>
                        </div>
                        <!-- 下拉列表 -->
                        <div class="slide" v-for="item in muselist" v-show="statearr==item.id" v-bind:key="item.id">
                            <p v-for="item1 in item.list" v-bind:class=" {'active':item1.flag}" @click="itemtype(item1.sid,item.id)" v-bind:key="item1.sid">
                                {{item1.name}} <span v-show="item1.flag" style="float: right"><img style="width:14px;vertical-align: middle;" src="~@/assets/img/duiduihao.png" alt=""></span>
                            </p>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 车险列表 -->
            <div class="listcontent">
                <!-- <div  v-show="chexianLists_null" class="null">
                <div class="myInsure_container" >
                    <div class="myInsure_all">
                        <div style="text-align: center;margin: 0 auto;">
                            <img style="margin-bottom: 30px; width:95px; height:95px;" src="~@/assets/img/myInsure_null.png" >
                            <p style="margin-bottom: 65px;color:rgba(153, 153, 153, 1); font-size: 16px;">未查询到您名下的保单信息</p>
                            <p style="margin-bottom: 21px;color: rgba(51, 51, 51, 1); font-size: 16px;" v-if="kunming_hidden">查询其他保单请点击</p>
                            <div class="myInsure_btn" v-if="kunming_hidden" ng-click="myInsure_null()">
                                <span>立即查询</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div> -->
                <div v-show="chexianLists_div" style="overflow:auto">
                    <div v-for="Num in cxlist" style="overflow:auto">
                        <div class="listitem lactive" v-for="num in Num.policys" v-show='num.show'>
                            <div @click="warrantyDetails(num,'c')">
                                <div class="itemtitle">
                                    <div class="itemtitle_div1">
                                        <span class="title1">{{num.riskname}}</span>
                                        <div :class="{stateactive1:num.number=='保障中',stateactive2:num.number=='已过期',stateactive3:num.number=='未起保'}" class="mystate">
                                            <!--&lt;!&ndash; <span class="state1">{{num.number}}</span> &ndash;&gt;-->
                                        </div>
                                    </div>
                                </div>
                                <div class="listitemcontent ">
                                    <p style="font-size: 14px;color: #666666">
                                        <span>投保车辆 :</span>
                                        <span>{{Num.licenseNo}}</span>
                                    </p>
                                    <p style="font-size: 14px;color: #666666">
                                        <!-- <p v-if="appliy_stateid==2||appliy_stateid==1"> -->
                                        <span>投保人 :</span>
                                        <span>{{num.appliname}}</span>
                                    </p >
                                    <p style="font-size: 14px;color: #666666">
                                        <!-- <p v-if="appliy_stateid==3||appliy_stateid==1"> -->
                                        <span>被保险人 :</span>
                                        <span>{{num.insname}}</span>
                                    </p>
                                    <p style="font-size: 12px;color: #999999">
                                        <span style="color: #999999">保险期限 :</span>
                                        <span v-if="num.startDate1 && num.endDate1" style="padding: 0 20px 0 0; display: block;  word-wrap: break-word; text-align: left; width: 70%; color: #999999">{{num.startDate1}}&nbsp至&nbsp{{num.endDate1}}</span>
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 非车险列表 -->
            <div class="listcontent2">
                <!-- <div  v-show="chexianLists_null_feichexian" class="null">
                <div class="myInsure_container" >
                    <div class="myInsure_all">
                        <div style="text-align: center;margin: 0 auto;">
                            <img style="margin-bottom: 30px; width:95px; height:95px;" src="~@/assets/img/myInsure_null.png" >
                            <p style="margin-bottom: 65px;color:rgba(153, 153, 153, 1); font-size: 16px;">未查询到您名下的保单信息</p>
                            <p style="margin-bottom: 21px;color: rgba(51, 51, 51, 1); font-size: 16px;" v-if="kunming_hidden">查询其他保单请点击</p>
                            <div class="myInsure_btn" v-if="kunming_hidden" ng-click="myInsure_null()">
                                <span>立即查询</span>
                            </div>
                        </div>
                    </div>
                </div>
             </div> -->
                <div v-show="chexianLists_div" style="overflow:auto">
                    <div v-for="Num in fxlist" style="overflow:auto">
                        <div class="listitem lactive1" v-for="num in Num.policys" v-show='num.show'>
                            <div @click="warrantyDetails(num,'f',num.riskname)">
                                <div class="itemtitle">
                                    <div class="itemtitle_div1">
                                        <span class="title1">{{num.riskname}}</span>
                                        <div :class="{stateactive1:num.number=='保障中',stateactive2:num.number=='已过期',stateactive3:num.number=='未起保'}" class="mystate">
                                            <!--&lt;!&ndash; <span class="state1">{{num.number}}</span> &ndash;&gt;-->
                                        </div>
                                    </div>
                                </div>
                                <div class="listitemcontent">
                                    <!-- <p v-if="appliy_stateid==2||appliy_stateid==1"> -->
                                    <p style="font-size: 14px;color: #666666">
                                        <span>投保人 :</span>
                                        <span>{{num.appliname}}</span>
                                    </p>
                                    <p style="font-size: 14px;color: #666666">
                                        <!-- <p v-if="appliy_stateid==3||appliy_stateid==1"> -->
                                        <span>被保险人 :</span>
                                        <span>{{num.insname}}</span>
                                    </p>
                                    <p style="font-size: 12px;color: #999999">
                                        <span style="color: #999999">保险期限 :</span>
                                        <span v-if="num.startDate1 && num.endDate1" style="color: #999999;padding: 0 20px 0 0; display: block;  word-wrap: break-word; text-align: left; width: 70%; ">{{num.startDate1}}&nbsp至&nbsp{{num.endDate1}}</span>
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 为查询到您名下的保单信息 v-if="Lists_null"-->
            <!-- <van-loading type="spinner" v-show="loadflag" color="#1989fa"  style="opacity:0; margin:1260px 0 560px 0;text-align: center;" /> -->
            <div v-if="Lists_null" class="null">
                <div class="myInsure_container" style="margin-top: 138px">
                    <div class="myInsure_all">
                        <div style="text-align: center;margin: 0 auto;">
                            <img style=" width:189px; " src="~@/assets/img/myInsure_null.png">
                            <p style="color: #666666; font-size: 14px;">您还没有可以查询的保单哦~</p>
                            <p style="color: #666666; margin-bottom: 10px ;font-size: 14px;" v-if="kunming_hidden">快去选购一份保障吧</p>
                            <div class="myInsure_btn" v-if="kunming_hidden" @click="myInsure_null()">
                                <span>去看看</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script lang="ts">
import '../../style/reservaIndex_index.css';
import 'vant/lib/toast/style';
import 'vant/lib/dialog/style';
import { Toast } from 'vant';
import { Component, Vue, Prop } from 'vue-property-decorator';
import { cloudApi } from '@/api/indexApi';
import Header from '@/components/Header.vue';
import { Alert } from '@/utils';
import { Dialog } from 'vant';
import func from 'vue-temp/vue-editor-bridge';
import Vue from 'vue';
import { Loading } from 'vant';
const AESEncode: any = (window as any).AESEncode;
const AESDecode: any = (window as any).AESDecode;
Vue.use(Loading);
Vue.use(Dialog);
Component.registerHooks(['beforeRouteUpdate', 'beforeRouteLeave', 'beforeRouteLeave']);
@Component({
    components: { Header },
})
export default class Myinsuretwo extends Vue {
    statearr: any = []
    sid: any = ''
    xian_state: string = ''
    appliy_state: string = ''
    policy_state: string = ''
    muselist: any = []
    InsufoLists_AllValue: any = []
    isActive: any = false
    x: any = ''
    riskname: any = ''
    policy_state_bz: any = 'true' //保障中
    policy_state_yg: any = 'true' //已过期
    flag: any = ''
    name: any = '' //当前用户的名字
    platenumbers: any = '' //车牌号 数组
    appliname: any = 'true' //投保人
    insname: any = 'false' //被保人
    cxlist: any = '' //车险
    fxlist: any = '' //非车险
    cxlist1: any = ''
    fxlist1: any = ''
    policys: any = ''
    riskcode1: any = '' //0507-交强险 else商业险
    xian_state: any = "险种"
    xian_stateid: any = '1'
    appliy_state: any = "身份"
    appliy_stateid: any = '1'
    policy_state: any = "保单状态"
    policy_stateid: any = '2'
    cx_shengxiao_count: any = 0 //车险有效中
    cx_shixiao_count: any = 0 //车险失效
    fc_shengxiao_count: any = 0 //非车险生效中
    fc_shixiao_count: any = 0 //非车险失效
    InsufoLists_AllValue: any = [] //车险 cxlist
    AutoInsufo_ListsValue: any = [] //
    fc_length: any = '' //非车险的长度
    // 盒子
    chexianLists: any = 'true' //车险
    feichexianLists: any = 'true' //非车险
    chexianLists_div: any = 'true' //车险div
    chexianLists_null: any = 'false' //车险长度是否0
    feichexianLists_div: any = 'true' //非车险div
    chexianLists_null_feichexian: any = 'false' //非车险长度是否0
    Lists_null: any = 'false'
    kunming_hidden: any = 'true' //立即查询
    statearr: any = 0 //当前列表状态muselist id
    sid: any = 0 //list sid
    cx_length: any = ''
    openId: any = ''
    aa: any = ''

    timeDifference1: any = ''
    timeDifference: any = ''
    isapp: any = ''
    app_true: any = false;
    heilongjiang_hidden: any = false;
    flagkhj: any = '';
    customerPhone: any = ''
    userId: any = ''
    appkey: any = ''
    type_card: any = ''
    id_card: any = ''
    party_id: any = ''
    lever: any = '2'
    myInsure_id: any = ''
    informationId: any = ''
    appid: any = ''
    code: any = ''
    uid: any = ''
    unionId: any = ''
    appopid: any = ''
    //点击我的保险
    ifSuperThree: any = true //确定我的名片加号是否显示
    Referee: any = false //推荐人标识
    newEnergy: any = false //新能源汽车绿色车牌
    normalCar: any = true //普通汽车蓝色车牌

    emailTrue: any = false;
    myInfo: any = { emailVal: ' 输入邮箱信息' }
    gou_xcx: any = true;
    BFDReady: any = false
    loadflag: any = false
    NumberUserid: any = false
    data() {
        return {
            muselist: [
                { id: 1, list: [{ sid: 1, name: '全部', flag: true }, { sid: 2, name: '车险', flag: false }, { sid: 3, name: '其他保险', flag: false }] },
                { id: 2, list: [{ sid: 1, name: '全部', flag: true }, { sid: 2, name: '投保人', flag: false }, { sid: 3, name: '被保险人', flag: false }] },
                { id: 3, list: [{ sid: 1, name: '全部', flag: false }, { sid: 2, name: '保障中', flag: true }, { sid: 3, name: '已过期', flag: false }, { sid: 4, name: '未起保', flag: false }] }
            ]
        }
    }
    created() {
        this.Lists_null = false
        this.myInsureClick()
    }

    mounted() {
        //         Toast.loading({
        //   duration: 0,
        //   message: '加载中...',
        //   forbidClick: true,
        // });
        document.title = '保单管理'
        if (window.history && window.history.pushState) {
            // 向历史记录中插入了当前页
            history.pushState(null, null, document.URL);
            window.addEventListener('popstate', this.goBack, false);
        }
    }
    destroyed() {
        window.removeEventListener('popstate', this.goBack, false);
    }

    goBack() {
        // window.history.back();
        if ((window as any).wx.miniProgram) {
            (window as any).wx.miniProgram.navigateBack({
                delta: history.length
            })
        }
    }
    //下拉框
    itemtype(num: any, num1: any) {
        this.sid = num;
        for (var i in this.muselist[num1 - 1].list) {
            this.muselist[num1 - 1].list[i].flag = false
        }
        this.muselist[num1 - 1].list[num - 1].flag = true
        if (this.statearr == 1) { //险种 车险 非车险
            this.xian_state = this.muselist[0].list[this.sid - 1].name
            this.xian_stateid = num
            if (this.muselist[0].list[this.sid - 1].sid == 2) { //车险
                this.chexianLists = true;
                this.feichexianLists = false;
            } else if (this.muselist[0].list[this.sid - 1].sid == 3) { //非车险
                this.feichexianLists = true;
                this.chexianLists = false;
            } else { //全部
                this.feichexianLists = true;
                this.chexianLists = true;
            }
        } else if (this.statearr == 2) { //身份 投保人 被投保人
            this.appliy_state = this.muselist[1].list[this.sid - 1].name
            this.appliy_stateid = num
            this.insname = true;
        } else if (this.statearr == 3) { //保单状态 保障中 已过期
            this.policy_state = this.muselist[2].list[this.sid - 1].name
            this.policy_stateid = num
        }
        this.muselistt()
        this.statearr = 0
    }
    renzheng() {
        var _this = this
        var address = location.href;
        if (address.split("?")[1].indexOf('userId=') > -1) {
            cloudApi.getToken({
                    mobile: address.split("phone_num=")[1],

                })
                .then(function(res) {
                    //aes解密
                    console.log("data", res)
                            //测试
                           // var url1 = "http://gscapptest.chinalife-p.com.cn:8060/unifUserH5/#/newpersonalInfo?userId=" + _this.NumberUserid + "&token=" + res.data.result.body.token+"&systemCode=S002"
                              //生产
                                var url1 ="https://axt.chinalife-p.com.cn/unifUserH5/#/newpersonalInfo?userId=" + _this.NumberUserid + "&token=" + res.data.result.body.token+"&systemCode=S002"
                            if (res.status = 200) {
                                if (res.data.result.body.token) {
                                    let params ={
                                      url:url1
                                    }

                                    params = JSON.stringify(params);
                                     const u = navigator.userAgent;
                                    const isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; // android终端
                                    const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios终端
                                        if (isAndroid) {
                                          window.SysClientJs.openWebviewByUrl(params);
                                        } else {
                                          window.webkit.messageHandlers.openWebviewByUrl.postMessage(params);
                                        }
                        }
                    }else{
                         Dialog.alert({ title: '温馨提示', message: '网络请求不给力，请稍后重试' });
                    }
                }).catch(err => {
                    Toast.clear();
                    Dialog.alert({ title: '温馨提示', message: '网络请求不给力，请稍后重试' });
                });

        } else {
            var demo = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx5668b394c2053c79&redirect_uri=https%3a%2f%2fwechat.chinalife-p.com.cn%2fwechatpageview%2fdist/index.html%3fappid%3dwx5668b394c2053c79&response_type=code&scope=snsapi_base&state=state_personalCard_openidoWcBG4_5kZ0fv4IGtgDUToTPLsmU_userId1405066_htmlpersonalInformation#wechat_redirect";
            //生产链接
            window.location.href = demo;
        }
    }
    muselistt() {
        if (this.appliy_stateid == 2) {
            this.fxlist1 = []
            this.cxlist1 = []
            for (var i in this.fxlist) {
                for (var q in this.fxlist[i].policys) {
                    if (this.fxlist[i].policys[q].appliname == this.name) {
                        // this.fxlist1.push(this.fxlist[i].policys[q])
                        this.fxlist[i].policys[q].show = true
                    } else {
                        this.fxlist[i].policys[q].show = false
                    }

                }
            }
            for (var i in this.cxlist) {
                for (var q in this.cxlist[i].policys) {
                    if (this.cxlist[i].policys[q].appliname == this.name) {
                        // this.cxlist1.push(this.cxlist[i].policys[q])
                        this.cxlist[i].policys[q].show = true
                    } else {
                        this.cxlist[i].policys[q].show = false
                    }

                }
            }

        } else if (this.appliy_stateid == 3) {
            this.fxlist1 = []
            this.cxlist1 = []
            for (var i in this.cxlist) {
                for (var q in this.cxlist[i].policys) {
                    if (this.cxlist[i].policys[q].insname == this.name) {
                        // this.cxlist1.push(this.cxlist[i].policys[q])
                        this.cxlist[i].policys[q].show = true
                    } else {
                        this.cxlist[i].policys[q].show = false
                    }

                }
            }
            for (var i in this.fxlist) {
                for (var q in this.fxlist[i].policys) {
                    if (this.fxlist[i].policys[q].insname == this.name) {
                        // this.fxlist1.push(this.fxlist[i].policys[q])
                        this.fxlist[i].policys[q].show = true
                    } else {
                        this.fxlist[i].policys[q].show = false
                    }

                }
            }

        } else {
            this.fxlist1 = []
            this.cxlist1 = []
            for (var i in this.fxlist) {
                for (var q in this.fxlist[i].policys) {
                    // this.fxlist1.push(this.fxlist[i].policys[q])
                    this.fxlist[i].policys[q].show = true
                }
            }
            for (var i in this.cxlist) {
                for (var q in this.cxlist[i].policys) {
                    // this.cxlist1.push(this.cxlist[i].policys[q])
                    this.cxlist[i].policys[q].show = true
                }
            }

        }

        if (this.policy_stateid == 2) {
            var fxlist2 = [];
            var cxlist2 = [];
            for (var i in this.fxlist) {
                for (var q in this.fxlist[i].policys) {
                    if (this.fxlist[i].policys[q].number == '保障中' && this.fxlist[i].policys[q].show == true) {
                        this.fxlist[i].policys[q].show = true
                    } else {
                        this.fxlist[i].policys[q].show = false
                    }

                }
            }
            // this.fxlist1=fxlist2
            for (var i in this.cxlist) {
                for (var q in this.cxlist[i].policys) {
                    if (this.cxlist[i].policys[q].number == '保障中' && this.cxlist[i].policys[q].show == true) {
                        this.cxlist[i].policys[q].show = true
                    } else {
                        this.cxlist[i].policys[q].show = false
                    }

                }
            }
            // this.cxlist1=cxlist2

        } else if (this.policy_stateid == 3) {
            var fxlist2 = [];
            var cxlist2 = [];
            for (var i in this.fxlist) {
                for (var q in this.fxlist[i].policys) {
                    if (this.fxlist[i].policys[q].number == '已过期' && this.fxlist[i].policys[q].show == true) {
                        this.fxlist[i].policys[q].show = true
                    } else {
                        this.fxlist[i].policys[q].show = false
                    }

                }
            }
            // this.fxlist1=fxlist2
            for (var i in this.cxlist) {
                for (var q in this.cxlist[i].policys) {
                    if (this.cxlist[i].policys[q].number == '已过期' && this.cxlist[i].policys[q].show == true) {
                        this.cxlist[i].policys[q].show = true
                    } else {
                        this.cxlist[i].policys[q].show = false
                    }

                }
            }
            // this.cxlist1=cxlist2

        } else if (this.policy_stateid == 4) {
            var fxlist2 = [];
            var cxlist2 = [];
            for (var i in this.fxlist) {
                for (var q in this.fxlist[i].policys) {
                    if (this.fxlist[i].policys[q].number == '未起保' && this.fxlist[i].policys[q].show == true) {
                        this.fxlist[i].policys[q].show = true
                    } else {
                        this.fxlist[i].policys[q].show = false
                    }

                }
            }
            // this.fxlist1=fxlist2
            for (var i in this.cxlist) {
                for (var q in this.cxlist[i].policys) {
                    if (this.cxlist[i].policys[q].number == '未起保' && this.cxlist[i].policys[q].show == true) {
                        this.cxlist[i].policys[q].show = true
                    } else {
                        this.cxlist[i].policys[q].show = false
                    }

                }
            }
            // this.cxlist1=cxlist2

        } else {
            for (var i in this.fxlist) {
                for (var q in this.fxlist[i].policys) {
                    //   this.fxlist[i].policys[q].show=true

                }
            }
            for (var i in this.cxlist) {
                for (var q in this.cxlist[i].policys) {
                    //    this.cxlist[i].policys[q].show=true
                }
            }
            // this.cxlist1=cxlist2

        }

        this.chexianLists_null_feichexian = true
        if (this.xian_stateid == 2) {
            for (var i in this.fxlist) {
                for (var q in this.fxlist[i].policys) {
                    this.fxlist[i].policys[q].show = false
                }
            }
        }
        for (var i in this.fxlist) {
            for (var q in this.fxlist[i].policys) {
                if (this.fxlist[i].policys[q].show == true) {
                    this.chexianLists_null_feichexian = false
                }
            }
        }


        this.chexianLists_null = true
        if (this.xian_stateid == 3) {
            for (var i in this.cxlist) {
                for (var q in this.cxlist[i].policys) {
                    this.cxlist[i].policys[q].show = false
                }
            }
        }
        for (var i in this.cxlist) {
            for (var q in this.cxlist[i].policys) {
                if (this.cxlist[i].policys[q].show == true) {
                    this.chexianLists_null = false
                }
            }
        }

        if (this.chexianLists_null_feichexian == true && this.chexianLists_null == true) {
            this.Lists_null = true
            if (this.policy_state == "保单状态") {
                this.policy_stateid = '1'
                this.policy_state = '全部'
                for (var i in this.muselist[2].list) {
                    this.muselist[2].list[i].flag = false
                }
                this.muselist[2].list[0].flag = true
                this.muselistt()
            }
        } else {
            this.Lists_null = false
        }

    }
    titlelist(num: any) {
        if (this.statearr == num) {
            this.statearr = 0
            this.isActive = false
        } else {
            this.statearr = num;
            this.isActive = true
        }

    }
    //我的保险、保单明细
    warrantyDetails(x: any, y: any, riskname: any = null) {
        //x是实参
        //y用来判断车险/非车险用于后面的埋点
        //riskname 保险名称
        var _this = this
        console.log("保单详情", x)
        localStorage.setItem('x', JSON.stringify(x)) //本地存储
        localStorage.setItem('y', JSON.stringify(y)) //本地存储
        localStorage.setItem('riskname', JSON.stringify(riskname)) //本地存储
        var reference: any = {
            openid: _this.openId,
            userid: _this.userId,
            code: _this.code,
            id_card: _this.id_card
        }
        localStorage.setItem('reference', JSON.stringify(reference))
        console.log("reference", reference)
        // if (_this.flag=="app") {
        //     console.log("app")
        //     _this.$router.push({
        //             path: 'AppPolicyDetails'
        //         })
        // }else{
        if (_this.lever != 2) {
            // _this.mainModal.hide();
            Toast.clear();
            Dialog.alert({ title: '温馨提示', message: '您当前没有权限查看保单详情，请前往我的-个人信息-信息维护中补充认证投保信息' });
            return;
        } else {
            _this.$router.push({
                path: 'PolicyDetails'
            })
        }
        // }


    }
    BuryingPoint(x: any, y: any) {
        this.BFDReady = false; //埋点是否初始化完毕标识
        window["_BFD"] = window["_BFD"] || {};
        _BFD.USER_INFO = {
            "cid": "Czgrs_cxgsh", //客户标识，实施人员提供
            "appkey": this.appkey, //应用标识，实施人员提供
            "pv_type": "0", //
            "pos": true, //是否启用鼠标点击事件，值为 true/false
            "link": true, //是否启用链接点击事件，值为 true/false
            "title": "", //当前页面标题，若此处不回传默认获取 document.title
            "openID": y || '', //站点在微信加载时，需回传 openID，否则不用做处理
            "phone_number": "", //手机号码，未登录时回传空字符串
            "uid": x || '' //用户 id，未登录时回传空字符串
        };
        _BFD.script = document.createElement("script");
        _BFD.script.async = true;
        _BFD.script.charset = "utf-8";
        // _BFD.script.src=('http://119.3.79.235:9999/jsapi/zgrsweb.js'); // js 代码路径，由实施人员提供
        _BFD.script.src = ('https://detector.chinalife-p.com.cn/jsapi/zgrsweb.new.js'); // js 代码路径，由实施人员提供
        document.getElementsByTagName("head")[0].appendChild(_BFD.script);
    };
    //获取保单信息列表
    myInsureList() {
        var _this = this;
        if (_this.flagkhj == "khj") { //客户节
            var data: any = {
                user_id: _this.userId,
                openid: _this.openId,
                name: _this.name,
                idtype: _this.type_card,
                idcard: _this.id_card,
                partyid: _this.party_id,
                authority: _this.lever,
                code: _this.code,
                customerPhone: _this.customerPhone,
                unionid: _this.unionId
            }
        } else {
            var data: any = {
                user_id: _this.userId,
                openid: _this.openId,
                name: _this.name,
                idtype: _this.type_card,
                idcard: _this.id_card,
                partyid: _this.party_id,
                authority: _this.lever,
                code: _this.code
            }
        }
        var data1: any = AESEncode(data);
        cloudApi
            .getMyPolicyListsInf({
                result: data1
            })
            .then(function(res) {
                _this.loadflag = false;
                //   Toast.clear();
                _this.getCardDetail(); //查询用户邮箱信息
                var data: any = JSON.parse(decodeURIComponent(atob(res.data.result)));
                console.log(data)
                if (data.result == 'notSame') {
                    //页面埋点报错
                    alert('openid和userid不一致');
                    return;
                }
                if (data.result == 'forSecure') {
                    //页面埋点报错
                    alert('code已失效');
                    return;
                }
                if (data.result == "jsonwrong") {
                    // 页面报错埋点
                    alert("输入的三要素和之前从平台中取的不一致");
                    return;
                }
                //alert("获取保单信息列表"+JSON.stringify(data));
                _this.cxlist = data.result.list1; //车险
                _this.fxlist = data.result.list2; //非车险
                _this.cx_length = _this.cxlist.length //车险的长度
                //车险循环
                _this.cxlist.forEach(function(x: any) {
                    x.policys.forEach(function(item: any) {
                        if (item.number == '失效') {
                            item.number = '已过期';
                            _this.cx_shixiao_count++;
                        } else if (item.number == '有效') {
                            item.number = '保障中';
                            _this.cx_shengxiao_count++;
                        }
                        if (item.riskcode == '0507') {
                            _this.riskcode1 = '交强险'
                        } else {
                            _this.riskcode1 = '商业险'
                        }
                        item.startDate1 = item.startDate.split('+')[0];
                        item.endDate1 = item.endDate.split('+')[0];
                    })
                });
                _this.InsufoLists_AllValue = _this.cxlist //车险
                var fclist: any = [] //非车险
                data.result.list2.forEach(function(item: any) {
                    fclist = fclist.concat(item.policys)
                });
                //非车险循环
                fclist.forEach(function(item) {
                    if (item.number == '失效') {
                        item.number = "已过期";
                        _this.fc_shixiao_count++;
                        item.fc_shixiao_count = 1;
                        item.fc_shengxiao_count = 0;
                    } else if (item.number == '有效') {
                        item.number = "保障中";
                        _this.fc_shengxiao_count++;
                        item.fc_shengxiao_count = 1;
                        item.fc_shixiao_count = 0;
                    }
                    item.startDate1 = item.startDate.split('+')[0];
                    item.endDate1 = item.endDate.split('+')[0];
                });
                _this.AutoInsufo_ListsValue = fclist; //非车险
                _this.fc_length = fclist.length;
                // _this.initSwitch($scope.cx_length, $scope.fc_length);
                console.log("车险生效", _this.cx_shengxiao_count, '车险失效', _this.cx_shixiao_count, '非车生效', _this.fc_shengxiao_count, '非车失效', _this.fc_shixiao_count)
                _this.muselistt()
            })
            .catch(err => {
                Toast.clear();
                // $scope.mainModal.hide();
                // 页面报错埋点
                //  Toast.clear();
                sensors.track('kf_PageError', {
                    page_title: document.title,
                    page_url: window.location.href,
                    error_reason: '暂时不能为您服务，请拨打95519或4008695519'
                });
                Toast.clear();
                Dialog.alert({ title: '温馨提示', message: '网络请求不给力，请稍后重试' });
            });
    }
    myInsure_null() {
        var address = location.href;
        if (address.split("?")[1].indexOf('userId=') > -1) { //app进入
            let params = {
                "index": 1
            }
            const u = navigator.userAgent;
            const isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; // android终端
            const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios终端
            if (isAndroid) {
                window.SysClientJs.gotoHomePage(JSON.stringify(params));
            } else {
                window.webkit.messageHandlers.gotoHomePage.postMessage(JSON.stringify(params));
            }
        } else {
            wx.miniProgram.switchTab({
                url: '/pages/civilinsurance/civilinsurance'
            });
        }
    }
    //立即查询
    jumpseach() {
        var _this = this
        //测试链接
        if (_this.app_true) { //app进入
            var demo = "https://wechat.chinalife-p.com.cn/wechatpageview/warranty_index.html?userId=" + _this.userId;
            // var demo = "https://wechattest.chinalife-p.com.cn/wechatpageview/warranty_index.html?userId=" + _this.userId;
        } else { //微信进入
            // var demo = "https://wechat.chinalife-p.com.cn/wechatpageview/warranty_index.html?appid=" + _this.appid + "&code=" + _this.code + "&state=" + _this.uid;
            //生产
            var demo = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx5668b394c2053c79&redirect_uri=https%3a%2f%2fwechat.chinalife-p.com.cn%2fwechatpageview%2fwarranty_index.html%3fappid%3dwx5668b394c2053c79&response_type=code&aaa=aa&scope=snsapi_base&state=e52b56e8423da66c17ad469b14778eb733e91e65442075c6e4739460d6eccaedopenidoWcBG426UritXl5FqGtlP3rf8a0E#wechat_redirect'
            wx.miniProgram.redirectTo({
                url: '/pages/webview/webview?url=' + encodeURIComponent(demo) + '&flag=1'
            });
            //var demo = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxb1b70bf91a06f3e5&redirect_uri=https%3a%2f%2fwechattest.chinalife-p.com.cn%2fwechatpageview%2fwarranty_index.html%3fappid%3dwxb1b70bf91a06f3e5&response_type=code&aaa=aa&scope=snsapi_base&state=82d5fa5048fae3251c0e5beadf2a6e7616c20c62cebde8e7a3a91453a1f9f69aopenidoWcBG4_5kZ0fv4IGtgDUToTPLsmU#wechat_redirect'
            // var demo = "https://wechattest.chinalife-p.com.cn/wechatpageview/warranty_index.html?appid=" + _this.appid + "&code=" + _this.code + "&state=" + _this.uid;
        }
        // var demo = "http://wechattest.chinalife-p.com.cn/wechatpageview/warranty_index.html?appid="+$scope.appid+"&code="+$scope.code+"&state="+$scope.uid;
        //生产链接
        window.location.href = demo;
    }
    myInsureClick() {
        var _this = this
        console.log("myInsureClick")
        _this.timeDifference = new Date().getTime(); //页面初始时间
        console.log(11, _this.timeDifference)
        //   $scope.mainModal.show();

        var address = location.href;
        //var address = 'http://wechattest.chinalife-p.com.cn/wechatpageview/myInsure_index.html?userId=545';
        // console.log(address);
        if (address.split("?")[1].indexOf('userId=') > -1) { //app进入
            _this.flag = 'app';
            localStorage.setItem('isappflag', "1")
            _this.app_true = true;
            _this.isapp = true;
            var params = _this.GetRequest(address);
            console.log(params);
            cloudApi.getToken({
                            mobile: address.split("phone_num=")[1]
                        })
                        .then(function(res) {
                            localStorage.setItem('maiuserid', res.data.result.body.userId)
                            cloudApi.newPointsInfo({
                                    userId: res.data.result.body.userId,
                                    operationCode: "1381908367600062464",
                                    action: "1",
                                    token: res.data.result.body.token
                                })
                                .then(function(res) {

                                })
                                .catch(err => {
                                    Toast.clear();
                                });
                        })
                        .catch(err => {
                            Toast.clear();
                        });
            if (params.flag == "khj") {
                _this.flagkhj = params.flag;
                _this.customerPhone = params.phone;
                var userId_a = params.userId;
            } else {
                //获取到userId值
                var userId_a = address.split("?")[1].split("userId=")[1];
            }
            if (userId_a.indexOf("&") > -1) {
                _this.userId = decodeURIComponent(userId_a.split("&")[0]).replace(/\ /g, '+');
            } else {
                _this.userId = decodeURIComponent(userId_a).replace(/\ /g, '+');
            }
            console.log(_this.userId);
            //aes加密
            var data = AESEncode({
                userid: _this.userId
            })
            cloudApi
                .desStringUserIdURL({
                    result: data
                })
                .then(function(res) {
                    //aes解密
                    var data = AESDecode(res.data.result)
                    // var data = AESDecode('1sJljUNyAnA+JlIFp8dhsRpZ0VyKZi6ZqJ02+PqeQvb5Slcs++HxWl+dYCwcvVZ4')

                    console.log("data", data)
                    _this.NumberUserid = data.NumberUserid
                    _this.openId = data.userid; //已加密
                    _this.userId = data.userid;
                    _this.appkey = "8be33c366d5845d41cca661e25996768"; //app埋点的appkey
                    console.log("userid", _this.userId)
                    _this.BuryingPoint(_this.userId, _this.openId);
                    _BFD.ActionCallBack = function() { //埋点初始化;
                        console.log('埋点初始化完成');
                        _this.BFDReady = true;
                    };
                    _this.queryUserInfoById();
                }).catch(err => {
                    Toast.clear();
                    Toast.clear();
                    // 页面报错埋点
                    sensors.track('kf_PageError', {
                        page_title: document.title,
                        page_url: window.location.href,
                        error_reason: '暂时不能为您服务，请拨打95519或4008695519'
                    });
                    Toast.clear();
                    Dialog.alert({ title: '温馨提示', message: '网络请求不给力，请稍后重试' });
                });
        } else {
            // if (this.$route.query.unionId) {
            //     _this.unionId = this.$route.query.unionId
            //     _this.openId = this.$route.query.openId
            // } else {
            // _this.unionId = address.split("?")[1].split("unionId=")[1].split("&")[0]
            // _this.appopid = address.split("?")[1].split("appopid=")[1].split("&")[0]

            // var address:any = 'https://wechattest.chinalife-p.com.cn/wechatpageview/myInsure_index.html?appid=wxb1b70bf91a06f3e5&code=071cEW000tFxgL1tS4000r6EE33cEW0D&state=appeal'
            // var address = 'http://wechattest.chinalife-p.com.cn/wechatpageview/myInsure_index.html?userId=545'
            var address = location.href;
            _this.appid = address.split("appid=")[1].split("&code")[0];
            _this.code = address.split("code=")[1].split("&state")[0]
            cloudApi.showInfo({ app_id: _this.appid, code: _this.code }).then(function(res: any) {
                if (res.data) {
                    if (res.data.openId) {
                        //  _this.unionId = res.data.unionId;
                        _this.openId = res.data.openId; //公总号openId
                        _this.getcard()
                    } else {
                        Toast.clear();
                        Dialog.alert({ title: '温馨提示', message: "网络请求不给力，请稍后重试" })
                    }
                } else {
                    Toast.clear();
                    Dialog.alert({ title: '温馨提示', message: "网络请求不给力，请稍后重试" })
                }
            });

            // }
        }

        _this.getEnv();
    }
    getEnv() {
        var _this = this
        console.log(_this.app_true);
        if (_this.app_true) {
            _this.gou_xcx = false;
        } else {
            if (-1 == navigator.userAgent.toLowerCase().indexOf("micromessenger")) {
                _this.gou_xcx = false;
                console.log("在其他浏览器中");
            } else {
                wx.miniProgram.getEnv((res: any) => {
                    console.log(res);
                    if (res.miniprogram) {
                        _this.gou_xcx = true;
                        console.log("在小程序中");
                    } else {
                        _this.gou_xcx = false;
                        console.log("在微信中");
                    }
                })
            }
        }
    }
    //通过userid查询用户信息2
    queryUserInfoById() {
        var _this = this
        //aes加密
        console.log("queryUserInfoById", _this.userId)
        var data: any = AESEncode({
            user_id: _this.userId
        })
        cloudApi
            .queryUserInfoByIdURL({
                result: data
            })
            .then(function(res) {
                var data: any = JSON.parse(decodeURIComponent(atob(res.data.result)));
                console.log(data);
                _this.name = data.result.user_name;
                _this.type_card = data.result.user_card_type;
                _this.id_card = data.result.user_card_no;
                _this.party_id = data.result.user_ecif_id;
                _this.lever = '2';
                _this.myInsure_id = data.result.user_id;
                _this.informationId = data.result.id;
                _this.lever = data.result.user_power
                _this.myInsureList()
            })
            .catch(err => {
                Toast.clear();
                // 页面报错埋点
                Toast.clear();
                sensors.track('kf_PageError', {
                    page_title: document.title,
                    page_url: window.location.href,
                    error_reason: '暂时不能为您服务，请拨打95519或4008695519'
                });
                Toast.clear();
                Dialog.alert({ title: '温馨提示', message: '网络请求不给力，请稍后重试' });
            });
    }
    GetRequest(urls: any) {
        var url = urls.split("?")[1]; //获取url中"?"符后的字串
        var z: any = new Object();
        if (url != undefined) {
            var x = url.split("&");
            for (var i = 0; i < x.length; i++) {
                z[x[i].split("=")[0]] = decodeURIComponent(x[i].split("=")[1]);
            }
        }
        return z;
    }
    GetRequest2(arr: any, str: any) {
        var z: any = new Object();
        var value = str.split('_')
        arr.map(function(key: any, index: any) {
            z[key] = value[index].substr(key.length);
        })
        return z;
    }
    // 获取unionid1
    getUnionId() {
        var _this = this
        if (_this.uid != 'appeal' && _this.uid != '') {
            if (window.location.href.indexOf('openid') != -1) {
                _this.unionId = window.location.href.split("state=")[1].split("openid")[0]
            } else {
                var data: any = AESEncode({
                    id: _this.uid
                })
                cloudApi
                    .getThreeidByIdURL({
                        result: data
                    })
                    .then(function(res) {
                        console.log(res)
                        var data: any = AESDecode(res.data.result)
                        console.log(data)
                        _this.unionId = data.unionid
                    })
                    .catch(err => {
                        Toast.clear();
                        console.log(err)
                    });
            }
        }
    }
    // getUnionIdAndOpenId(){
    //   var _this = this;
    //   cloudApi
    //     .getUnionIdAndOpenId({
    //       appid: _this.appid,
    //       code: _this.code,
    //     })
    //     .then(function(res: any) {
    //       if (res.data) {
    //         if(res.data.unionId){
    //           _this.unionId = res.data.unionId;
    //           sessionStorage.setItem('unionId', res.data.unionId||'');
    //           _this.openId = res.data.openId;
    //           _this.getcard();
    //           sessionStorage.setItem('openId', res.data.openId||'');
    //         }
    //       }
    //     });
    // }
    //名片初始化1
    getcard() {
        var _this = this
        var data: any = AESEncode({
            openid: _this.openId,
            unionid: ""
        })
        console.log("unionId——zwh", _this.unionId)
        console.log(data)
        cloudApi
            .getMyBussinessCard({
                result: data
            })
            .then(function(res) {
                var data: any = AESDecode(res.data.result)
                console.log("getMyBussinessCard 密", data)
                if (data.result.length == 0) {
                    // _this.$router.push('view/myInformation/myInformation_customer.html')
                    _this.$router.push({
                        path: 'checkPhoneInfo',
                        query: {
                            unionId: _this.unionId,
                            openId: _this.openId,
                            route: JSON.stringify({
                                path: 'Myinsure',
                                query: {
                                    unionId: _this.unionId,
                                    appopid: _this.appopid
                                },
                            })
                        },
                    });
                    // $scope.mainInfo.pushPage("view/myInformation/myInformation_customer.html"); //如果没有数据跳转到输入手机号页面
                    return;
                } else {

                    console.log(data.result);
                    var mycard = data.result[0];
                    _this.userId = mycard.user_id;
                    _this.name = mycard.name;
                    _this.type_card = mycard.type_card;
                    _this.id_card = mycard.id_card;
                    _this.party_id = mycard.party_id;
                    _this.lever = mycard.lever;
                    _this.myInsure_id = mycard.id;
                    _this.informationId = mycard.id;
                    cloudApi.getToken({
                            mobile: mycard.mobile_Phone
                        })
                        .then(function(res) {
                            localStorage.setItem('maiuserid', res.data.result.body.userId)
                            cloudApi.newPointsInfo({
                                    userId: res.data.result.body.userId,
                                    operationCode: "1381908367600062464",
                                    action: "1",
                                    token: res.data.result.body.token
                                })
                                .then(function(res) {

                                })
                                .catch(err => {
                                    Toast.clear();
                                });
                        })
                        .catch(err => {
                            Toast.clear();
                        });
                    _this.myInsureList()
                    // $scope.mainInfo.pushPage("view/myInsure/myInsure.html");
                    return;
                }
            })
            .catch(err => {
                Toast.clear();
                // $scope.mainModal.hide();
                // // 页面报错埋点
                sensors.track('kf_PageError', {
                    page_title: document.title,
                    page_url: window.location.href,
                    error_reason: '暂时不能为您服务，请拨打95519或4008695519'
                });
            });
    }
    //查询用户邮箱信息
    // $scope.myInfo.emailVal = "请输入邮箱信息"
    getCardDetail() {
        // $scope.mainModal.show();
        var _this = this
        //aes加密
        var data1: any = AESEncode({
            id: _this.informationId,
            idCard: _this.id_card,
            partyId: _this.party_id,
            typeCard: _this.type_card
        });
        console.log("aes加密", data1)
        cloudApi
            .getMyBussinessCardDetailURL({
                result: data1
            })
            .then(function(res) {
                // $scope.mainModal.hide();
                // 页面加载埋点
                _this.timeDifference1 = new Date().getTime()
                var time = (_this.timeDifference1 - _this.timeDifference) / 1000;
                sensors.track('kf_PageLoading', {
                    page_title: document.title,
                    page_url: window.location.href,
                    loading_duration: time,
                    is_loading_success: '加载成功'
                })
                //aes解密
                var data: any = AESDecode(res.data.result);
                console.log("aes解密", data);
                if (data == "解密出错") {
                    _this.myInfo.emailVal = '';
                } else {
                    _this.myInfo.emailVal = data.result.email;
                }
                console.log("用户绑定邮箱信息", _this.myInfo.emailVal);
                _this.emailTrue = true;
                var email: any = {
                    myInfo: _this.myInfo,
                    emailTrue: _this.emailTrue
                }
                localStorage.setItem('email', JSON.stringify(email))

            })
            .catch(err => {
                Toast.clear();
                // 页面加载埋点
                _this.timeDifference1 = new Date().getTime()
                var time = (_this.timeDifference1 - _this.timeDifference) / 1000;
                sensors.track('kf_PageLoading', {
                    page_title: document.title,
                    page_url: window.location.href,
                    loading_duration: time,
                    is_loading_success: '加载失败'
                })
                // 页面报错埋点
                sensors.track('kf_PageError', {
                    page_title: document.title,
                    page_url: window.location.href,
                    error_reason: err
                });
                // $scope.mainModal.hide();
                _this.emailTrue = true;
                console.log("查询邮箱失败");
            });
    }
}
</script>
<style lang="less" scoped>
.myinsuretwo {
    width: 100%;
    min-height: 100%;
    overflow: hidden;
    background-color: #F6F7FB;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;

}

.contentempt {
    width: 100%;
    height: 35px;
}

.myinsuretwo_center {
    /* width: 90%; */
    overflow: hidden;
    margin: 0 auto;
    margin-top: 92px;
    margin-bottom: 9px;
}

.titlewai {
    position: fixed;
    top: 0;
    width: 100%;
}

.title {
    width: 100%;
    height: 42px;
    background-color: #ffffff;
    /* margin-top: 10px; */
    /* border-radius: 10px; */

    /* left: 5%; */
}

.titleone {
    width: 100%;
    height: 35px;
    background-color: #FFF6E5;
    color: #F6B630;
    font-size: 13px;
    /* line-height: 35px; */

}

.titleone p {
    display: inline-block;
    /* vertical-align:middle */
    /* height: 14px; */
    /* margin-top: 11px; */

}

.titleone img {
    width: 15px;
    height: 14px;
    /*  margin-left: 25px;
    margin-right: 6px; */
    /* vertical-align:middle */

}

.titletwo {
    width: 100%;
    height: 50px;
    background-color: #08C29F;
    font-size: 16px;
    color: white;

}

.titletwop1 {
    margin-left: 25px;
    line-height: 50px;
    display: inline-block;
}

.titletwop2 {
    display: inline-block;
    width: 92px;
    /* height: 26px; */
    float: right;
    border: 1px white solid;
    border-radius: 18px 0 0 18px;
    margin-top: 12px;
    font-size: 13px;
    /* line-height: 26px; */
    color: white;
    background-color: #7edecc;
    text-indent: 9px;
    padding: 2px 0 3px 0;
}

.titlecontent {
    width: 100%;
    height: 100%;
    position: relative;
}

.titlec {
    width: 100%;
    height: 100%;
    display: flex;
}

.titlec p {
    /* text-align: center; */
    font-size: 14px;
    color: #234439;
    line-height: 42px;
}

.titleitem {
    position: relative;
}

.titlec p:after {
    content: "";
    width: 1px;
    height: 15px;
    border-left: 1px #E5E5E5 solid;
    position: absolute;
    right: 0;
    top: 13px;
}

.titlec p:nth-child(3):after {
    border: none;
}

.titlec p:nth-child(1) {
    width: 90px;
    padding: 0 0 0 22px;
}

.titlec p:nth-child(2) {
    width: 90px;
    padding: 0 30px;
    text-align: center;
}

.titlec p:nth-child(3) {
    width: 102px;
    padding: 0 20px 0 0;
    text-align: right;
}

.titlec p img {
    width: 10px;
    padding: 0 2px;
    margin-left: 12px;
    vertical-align: middle;

}

.titlec p .active {
    transform: rotate(180deg);
}

.titlec p .activespan {
    color: #009B63;
}

.slide {
    position: absolute;
    width: 100%;
    overflow: hidden;
    margin-top: -1px;
    background: white;
}

.slide .active {
    color: #009B63;
}

.slide p {
    width: 90%;
    margin: 0 auto;
    height: 46px;
    line-height: 42px;
    background-color: white;
    font-size: 14px;
    border-bottom: 1px #E5E5E5 solid;
    color: #666666;
}

.slide p:last-child {
    border-bottom: none;
}

.slide p:first-child {
    background-color: white;
}

/* 车险 */
.listcontent {
    width: 100%;
    overflow: hidden;
    /*background-color: #FAF9F7;*/
    /* margin-bottom: -14px; */
}

.listitem {
    width: 353px;
    height: auto;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
    padding-bottom: 13px;
}

.itemtitle {
    width: 100%;
    height: 39px;
    margin-bottom: 8px;
}

.itemtitle_div1 {
    width: 100%;
    height: 100%;
}

.itemtitle_div1>.title1 {
    width: 80%;
    color: #222222;
    padding: 0 0 0 20px;
    font-size: 16px;
    display: block;
    float: left;
    margin: 14px 0 0 0;
    font-weight: bolder;
}

.itemtitle_div1 .title {
    width: 70%;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;

}

.itemtitle_div1 .mystate {
    float: right;
    width: 49px;
    height: 18px;
    margin: 16px 13px 0 0;
}

.stateactive1 {
    background-image: url(../../assets/img/q1.png);
    background-repeat: no-repeat;
    background-size: 100%;
}

.stateactive2 {
    background-image: url(../../assets/img/q2.png);
    background-repeat: no-repeat;
    background-size: 100%;
}

.stateactive3 {
    background-image: url(../../assets/img/q3.png);
    background-repeat: no-repeat;
    background-size: 100%;
}

.itemtitle_div1 div .state1 {
    font-size: 14px;
    color: #ffff;
    letter-spacing: 1px;
    padding: 0 12px;
    display: block;
    margin: 7px 0 0 0;
    width: 75px;
    text-align: center;
}

.listitemcontent {
    width: 88%;
    overflow: hidden;
    /* padding: 0 0 10px 0; */
    /*margin-top: 0.373333rem;*/
    margin: 0 auto;
    padding-top: 8px;
    border-top: 1px #E5E5E5 solid;
}

.lactive {
    /*background-image: url(../../assets/img/g1.png);*/
    background-repeat: no-repeat;
    background-size: 100%;
    /*box-shadow: 1px 5px 10px #eaeaea;*/
    /* box-shadow: 0px 10px 0px 0px #fff0,-10px 0px 10px 10px #eaeaea, 10px 0px 10px 10px #eaeaea, 0px 10px 1px 1px #eaeaea; */
}

.lactive1 {
    /*background-image: url(../../assets/img/g2.png);*/
    background-repeat: no-repeat;
    background-size: 100%;
    /*  box-shadow: 1px 5px 10px #eaeaea; */
    height: 146px
}

.listitemcontent p {
    width: 100%;
    font-size: 0.346667rem;
    overflow: hidden;
    height: auto;
    line-height: 0.693333rem;
    margin: 0 auto;
}

.listitemcontent p:last-child {
    margin-top: 3px;
}

.listitemcontent p span {
    font-size: 13px;
    color: #234439;
}

.listitemcontent p span:first-child {
    /*padding: 0 0 0 20px;*/
    display: block;
    /*width: 30%;*/
    display: block;
    float: left;
    color: #666666;
    margin-right: 14px;
}

.listitemcontent p span:last-child {
    /*padding: 0 20px 0 0;*/
    display: block;
    word-wrap: break-word;
    text-align: left;
    width: 176px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    /*float: right;*/
    color: #666666;
}

/* 非车险 */
.listcontent2 {
    width: 100%;
    overflow: hidden;
    /*background-color: #FAF9F7;*/

}

.listitem2 {
    width: 100%;
    overflow: hidden;
    margin: 15px 0;
    background-color: #ffff;
}

.itemtitle2 {
    width: 100%;
    height: 45px;
}

.itemtitle2 div {
    width: 100%;
    height: 100%;
    line-height: 45px;
}

.itemtitle2 div span {
    color: #C5A457;
    padding: 0 0 0 21px;
    font-size: 14px;
}

.itemtitle2 div div {
    float: right;
    margin-right: -2px;
    width: 75px;
    height: 45px;
    border-radius: 0 0 50px 75px;
    background-color: teal;
}

.itemtitle2 div div span {
    font-size: 14px;
    color: #ffff;
    letter-spacing: 1px;
}

.listitemcontent2 {
    width: 100%;
    overflow: hidden;
    padding: 0 0 10px 0;
}

.listitemcontent2 p {
    width: 100%;
    margin: 10px 0;
    ;
}

.listitemcontent2 p span {
    font-size: 14px;
    color: #234439;
}

.listitemcontent2 p span:first-child {
    padding: 0 0 0 20px;
}

.listitemcontent2 p span:last-child {
    padding: 0 20px 0 0;
    float: right;
}

.bgcolor1 {
    background-color: teal;
}

.bgcolor2 {
    background-color: tomato;
}

.bgcolor3 {
    background-color: blue;
}

.myInsure_btn {
    width: 125px;
    height: 35px;
    border-radius: 28px;
    text-align: center;
    vertical-align: middle;
    line-height: 35px;
    margin: 0 auto;
    border: 1px #1B9971 solid;
    color: #1B9971;
}

.myInsure_btn span {
    font-family: PingFang SC;
    font-size: 14px;
}

.null {
    width: 100%;
    height: 550px;
    /*  display: flex;
    align-items: center; */
    justify-content: center;
}
</style>